<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: BinarySearchTree&lt; Comparable &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">My Project
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classBinarySearchTree-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">BinarySearchTree&lt; Comparable &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>BinarySearchTree的Comparable模板类;.  
 <a href="classBinarySearchTree.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="BinarySearchTree_8h_source.html">BinarySearchTree.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a93b575b9a03bae5a402f69a1a3b96d8f"><td class="memItemLeft" align="right" valign="top"><a id="a93b575b9a03bae5a402f69a1a3b96d8f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a93b575b9a03bae5a402f69a1a3b96d8f">BinarySearchTree</a> ()</td></tr>
<tr class="memdesc:a93b575b9a03bae5a402f69a1a3b96d8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认BinarySearchTree构造函数; <br /></td></tr>
<tr class="separator:a93b575b9a03bae5a402f69a1a3b96d8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a399127538d6b6e1581396cafa5d3aa6e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a399127538d6b6e1581396cafa5d3aa6e">BinarySearchTree</a> (const <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> &amp;rhs)</td></tr>
<tr class="memdesc:a399127538d6b6e1581396cafa5d3aa6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">有左值传入的BinarySearchTree构造函数;  <a href="classBinarySearchTree.html#a399127538d6b6e1581396cafa5d3aa6e">More...</a><br /></td></tr>
<tr class="separator:a399127538d6b6e1581396cafa5d3aa6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5a89639e88a69c7c8ed757e9a910fdf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#af5a89639e88a69c7c8ed757e9a910fdf">BinarySearchTree</a> (<a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> &amp;&amp;rhs)</td></tr>
<tr class="memdesc:af5a89639e88a69c7c8ed757e9a910fdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">有右值传入的BinarySearchTree构造函数;  <a href="classBinarySearchTree.html#af5a89639e88a69c7c8ed757e9a910fdf">More...</a><br /></td></tr>
<tr class="separator:af5a89639e88a69c7c8ed757e9a910fdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32b5d201d1882fed79be9e0db0a65efc"><td class="memItemLeft" align="right" valign="top"><a id="a32b5d201d1882fed79be9e0db0a65efc"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a32b5d201d1882fed79be9e0db0a65efc">~BinarySearchTree</a> ()</td></tr>
<tr class="memdesc:a32b5d201d1882fed79be9e0db0a65efc"><td class="mdescLeft">&#160;</td><td class="mdescRight">默认BinarySearchTree析构函数; <br /></td></tr>
<tr class="separator:a32b5d201d1882fed79be9e0db0a65efc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28066217f90c86d362b8db2a00f5c6b1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a28066217f90c86d362b8db2a00f5c6b1">operator=</a> (const <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> &amp;rhs)</td></tr>
<tr class="memdesc:a28066217f90c86d362b8db2a00f5c6b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">重载=号(赋值)，同时避免了更改rhs的地址;  <a href="classBinarySearchTree.html#a28066217f90c86d362b8db2a00f5c6b1">More...</a><br /></td></tr>
<tr class="separator:a28066217f90c86d362b8db2a00f5c6b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab8c5df2c527a9aff70a5addae99cab2f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#ab8c5df2c527a9aff70a5addae99cab2f">operator=</a> (<a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> &amp;&amp;rhs)</td></tr>
<tr class="memdesc:ab8c5df2c527a9aff70a5addae99cab2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">重载=号(赋值)，swap函数直接交换地址，因为右值对象马上会被释放;  <a href="classBinarySearchTree.html#ab8c5df2c527a9aff70a5addae99cab2f">More...</a><br /></td></tr>
<tr class="separator:ab8c5df2c527a9aff70a5addae99cab2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27264b8257042bced77b5a3ed554aca5"><td class="memItemLeft" align="right" valign="top">const Comparable &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a27264b8257042bced77b5a3ed554aca5">findMin</a> () const</td></tr>
<tr class="memdesc:a27264b8257042bced77b5a3ed554aca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">找BinarySearchTree类中存储的最小的元素;  <a href="classBinarySearchTree.html#a27264b8257042bced77b5a3ed554aca5">More...</a><br /></td></tr>
<tr class="separator:a27264b8257042bced77b5a3ed554aca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23eff12a71929966684d056b7ddc89dd"><td class="memItemLeft" align="right" valign="top">const Comparable &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a23eff12a71929966684d056b7ddc89dd">findMax</a> () const</td></tr>
<tr class="memdesc:a23eff12a71929966684d056b7ddc89dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">找BinarySearchTree类中存储的最小的元素;  <a href="classBinarySearchTree.html#a23eff12a71929966684d056b7ddc89dd">More...</a><br /></td></tr>
<tr class="separator:a23eff12a71929966684d056b7ddc89dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a234431661b762fd4df77c5c6d0b3b1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a1a234431661b762fd4df77c5c6d0b3b1">contains</a> (const Comparable &amp;x) const</td></tr>
<tr class="memdesc:a1a234431661b762fd4df77c5c6d0b3b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断x元素是否在BinarySearchTree中;  <a href="classBinarySearchTree.html#a1a234431661b762fd4df77c5c6d0b3b1">More...</a><br /></td></tr>
<tr class="separator:a1a234431661b762fd4df77c5c6d0b3b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b2d9cdc6a90f6dd9cfe753958d5ce1d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a6b2d9cdc6a90f6dd9cfe753958d5ce1d">isEmpty</a> () const</td></tr>
<tr class="memdesc:a6b2d9cdc6a90f6dd9cfe753958d5ce1d"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断BinarySearchTree是否为空树;  <a href="classBinarySearchTree.html#a6b2d9cdc6a90f6dd9cfe753958d5ce1d">More...</a><br /></td></tr>
<tr class="separator:a6b2d9cdc6a90f6dd9cfe753958d5ce1d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ddd2becc339171650a6fe9ed6481b49"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a8ddd2becc339171650a6fe9ed6481b49">printTree</a> (ostream &amp;out=cout) const</td></tr>
<tr class="memdesc:a8ddd2becc339171650a6fe9ed6481b49"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过调用私有类中的printList函数，用中序遍历将BinarySearchTree树中元素打印出来;  <a href="classBinarySearchTree.html#a8ddd2becc339171650a6fe9ed6481b49">More...</a><br /></td></tr>
<tr class="separator:a8ddd2becc339171650a6fe9ed6481b49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e79b79da19f7cd0a7bc854f746bae7c"><td class="memItemLeft" align="right" valign="top"><a id="a1e79b79da19f7cd0a7bc854f746bae7c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a1e79b79da19f7cd0a7bc854f746bae7c">makeEmpty</a> ()</td></tr>
<tr class="memdesc:a1e79b79da19f7cd0a7bc854f746bae7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过调用私有类中的makeEmpty函数清空BinarySearchTree; <br /></td></tr>
<tr class="separator:a1e79b79da19f7cd0a7bc854f746bae7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3747b26226a3205295b9b56d51eba9e6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a3747b26226a3205295b9b56d51eba9e6">insert</a> (const Comparable &amp;x)</td></tr>
<tr class="memdesc:a3747b26226a3205295b9b56d51eba9e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过调用私有类中的insert函数将传入的Comparable对象的左值引用x插入到BinarySearchTree中;  <a href="classBinarySearchTree.html#a3747b26226a3205295b9b56d51eba9e6">More...</a><br /></td></tr>
<tr class="separator:a3747b26226a3205295b9b56d51eba9e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00c741c480cf0fc2ffd478e66aa5eb55"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a00c741c480cf0fc2ffd478e66aa5eb55">insert</a> (Comparable &amp;&amp;x)</td></tr>
<tr class="memdesc:a00c741c480cf0fc2ffd478e66aa5eb55"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过调用私有类中的insert函数将传入的Comparable对象的右值引用x插入到BinarySearchTree中;  <a href="classBinarySearchTree.html#a00c741c480cf0fc2ffd478e66aa5eb55">More...</a><br /></td></tr>
<tr class="separator:a00c741c480cf0fc2ffd478e66aa5eb55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27118a2c01d39ccaa07d55a3507d4f24"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a27118a2c01d39ccaa07d55a3507d4f24">remove</a> (const Comparable &amp;x)</td></tr>
<tr class="memdesc:a27118a2c01d39ccaa07d55a3507d4f24"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过调用私有类中的remove函数将传入的Comparable对象的引用x从BinarySearchTree中移除;  <a href="classBinarySearchTree.html#a27118a2c01d39ccaa07d55a3507d4f24">More...</a><br /></td></tr>
<tr class="separator:a27118a2c01d39ccaa07d55a3507d4f24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dfb13e00236626dd2ae3a8ccad335a5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classBinarySearchTree.html#a6dfb13e00236626dd2ae3a8ccad335a5">add</a> (std::vector&lt; Comparable &gt; &amp;arr) const</td></tr>
<tr class="memdesc:a6dfb13e00236626dd2ae3a8ccad335a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过调用私有类中的add函数将排好序后的元素返回到arr所引用的数组对象;  <a href="classBinarySearchTree.html#a6dfb13e00236626dd2ae3a8ccad335a5">More...</a><br /></td></tr>
<tr class="separator:a6dfb13e00236626dd2ae3a8ccad335a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Comparable&gt;<br />
class BinarySearchTree&lt; Comparable &gt;</h3>

<p>BinarySearchTree的Comparable模板类;. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Comparable</td><td>BinarySearchTree的类型; </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a399127538d6b6e1581396cafa5d3aa6e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a399127538d6b6e1581396cafa5d3aa6e">&#9670;&nbsp;</a></span>BinarySearchTree() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::<a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt; &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>有左值传入的BinarySearchTree构造函数; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>传入的BinarySearchTree左值引用rhs; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af5a89639e88a69c7c8ed757e9a910fdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af5a89639e88a69c7c8ed757e9a910fdf">&#9670;&nbsp;</a></span>BinarySearchTree() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::<a class="el" href="classBinarySearchTree.html">BinarySearchTree</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt; &amp;&amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>有右值传入的BinarySearchTree构造函数; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>传入的BinarySearchTree右值引用rhs; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a6dfb13e00236626dd2ae3a8ccad335a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6dfb13e00236626dd2ae3a8ccad335a5">&#9670;&nbsp;</a></span>add()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::add </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; Comparable &gt; &amp;&#160;</td>
          <td class="paramname"><em>arr</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>通过调用私有类中的add函数将排好序后的元素返回到arr所引用的数组对象; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">arr</td><td>将数据返回到的数组对象arr的引用; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a1a234431661b762fd4df77c5c6d0b3b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a234431661b762fd4df77c5c6d0b3b1">&#9670;&nbsp;</a></span>contains()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::contains </td>
          <td>(</td>
          <td class="paramtype">const Comparable &amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断x元素是否在BinarySearchTree中; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>传入的Comparable类型对象的const引用; </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>通过调用私有类中contains函数，若x元素存在则返回true;否则返回false; </dd></dl>

</div>
</div>
<a id="a23eff12a71929966684d056b7ddc89dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a23eff12a71929966684d056b7ddc89dd">&#9670;&nbsp;</a></span>findMax()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const Comparable&amp; <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::findMax </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>找BinarySearchTree类中存储的最小的元素; </p>
<dl class="section return"><dt>Returns</dt><dd>若树是空的，直接报错，否则通过调用私有类中findMax函数返回*BinarySearchNode-&gt;element，即指针指向的最大元素; </dd></dl>

</div>
</div>
<a id="a27264b8257042bced77b5a3ed554aca5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27264b8257042bced77b5a3ed554aca5">&#9670;&nbsp;</a></span>findMin()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const Comparable&amp; <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::findMin </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>找BinarySearchTree类中存储的最小的元素; </p>
<dl class="section return"><dt>Returns</dt><dd>若树是空的，直接报错，否则通过调用私有类中findMin函数返回*BinarySearchNode-&gt;element，即指针指向的最小元素; </dd></dl>

</div>
</div>
<a id="a00c741c480cf0fc2ffd478e66aa5eb55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00c741c480cf0fc2ffd478e66aa5eb55">&#9670;&nbsp;</a></span>insert() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::insert </td>
          <td>(</td>
          <td class="paramtype">Comparable &amp;&amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>通过调用私有类中的insert函数将传入的Comparable对象的右值引用x插入到BinarySearchTree中; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>传入的Comparable对象的const右值引用x; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3747b26226a3205295b9b56d51eba9e6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3747b26226a3205295b9b56d51eba9e6">&#9670;&nbsp;</a></span>insert() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::insert </td>
          <td>(</td>
          <td class="paramtype">const Comparable &amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>通过调用私有类中的insert函数将传入的Comparable对象的左值引用x插入到BinarySearchTree中; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>传入的Comparable对象的const左值引用x; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6b2d9cdc6a90f6dd9cfe753958d5ce1d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b2d9cdc6a90f6dd9cfe753958d5ce1d">&#9670;&nbsp;</a></span>isEmpty()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::isEmpty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断BinarySearchTree是否为空树; </p>
<dl class="section return"><dt>Returns</dt><dd>若树非空，返回false，反之返回true; </dd></dl>

</div>
</div>
<a id="ab8c5df2c527a9aff70a5addae99cab2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab8c5df2c527a9aff70a5addae99cab2f">&#9670;&nbsp;</a></span>operator=() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&amp; <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt; &amp;&amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>重载=号(赋值)，swap函数直接交换地址，因为右值对象马上会被释放; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>const引用符号右侧的BinarySearchTree类右值对象; </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>指针this指向的BinarySearchTree对象; </dd></dl>

</div>
</div>
<a id="a28066217f90c86d362b8db2a00f5c6b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28066217f90c86d362b8db2a00f5c6b1">&#9670;&nbsp;</a></span>operator=() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&amp; <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt; &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>重载=号(赋值)，同时避免了更改rhs的地址; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rhs</td><td>const引用符号右侧的BinarySearchTree类左值对象; </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>指针this指向的BinarySearchTree对象; </dd></dl>

</div>
</div>
<a id="a8ddd2becc339171650a6fe9ed6481b49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ddd2becc339171650a6fe9ed6481b49">&#9670;&nbsp;</a></span>printTree()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::printTree </td>
          <td>(</td>
          <td class="paramtype">ostream &amp;&#160;</td>
          <td class="paramname"><em>out</em> = <code>cout</code></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>通过调用私有类中的printList函数，用中序遍历将BinarySearchTree树中元素打印出来; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">out</td><td>ostream类对象的一个引用，默认是cout的引用; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a27118a2c01d39ccaa07d55a3507d4f24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27118a2c01d39ccaa07d55a3507d4f24">&#9670;&nbsp;</a></span>remove()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Comparable &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classBinarySearchTree.html">BinarySearchTree</a>&lt; Comparable &gt;::remove </td>
          <td>(</td>
          <td class="paramtype">const Comparable &amp;&#160;</td>
          <td class="paramname"><em>x</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>通过调用私有类中的remove函数将传入的Comparable对象的引用x从BinarySearchTree中移除; </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">x</td><td>传入的Comparable对象的const引用x; </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="BinarySearchTree_8h_source.html">BinarySearchTree.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
